using Domain.Dto;
using Gmmy.DomainExtension;
using Gmmy.Utility;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Domain.Model
{
    /// <summary>
    /// 用户角色模型
    /// </summary>
    public class RoleModuleRelation : EntityBase
    {
		#region 领域对象属性
        /// <summary>
        /// 编号
        /// </summary>
        [DisplayName(@"编号")]
        [Key]
        public Guid ID { get; set; }

        /// <summary>
        /// 角色编号
        /// </summary>
        [DisplayName(@"角色编号")]
        public Guid RoleId { get; set; }

        /// <summary>
        /// 模块编号
        /// </summary>
        [DisplayName(@"模块编号")]
        public Guid ModuleId { get; set; }

        /// <summary>
        /// 权重
        /// </summary>
        [DisplayName(@"权重")]
        public Guid ActionId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [DisplayName(@"创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        [DisplayName(@"逻辑删除")]
        public bool IsDeleted { get; set; }


        #endregion

		#region 领域对象行为
		public RoleModuleRelation() { }//空构造函数

        public RoleModuleRelation(Guid roleId, Guid moduleId,Guid actionId)
        {
            ID = Guid.NewGuid();
            RoleId = roleId;
            ModuleId = moduleId;
            ActionId = actionId;
            CreateTime = DateTime.Now;
            IsDeleted = false;
        }

        #endregion

    }
}